#ifndef NOTIFICATION_MANAGER_H
#define NOTIFICATION_MANAGER_H

#define MAX_AMOUNT_OF_THREADS		10

#include "Notification.h"
#include <queue>
#include <vector>
#include "Poco/Thread.h"
#include "Poco/Semaphore.h"

using namespace std;


class NotificationManager : public Poco::Runnable
{
private:
	NotificationManager(void);
	static NotificationManager *g_pkInstance;

public:
	~NotificationManager(void);
	static NotificationManager *GetInstance();
	
	//init threads, esto deberia ser el run()?

	void AddNotification(Notification *notif);
	void run();

private:
	queue<Notification*> m_qNotificationQueue;
	//vector de threads
	vector<Poco::Thread*> m_vtrThreads;
	Poco::Semaphore *m_pkSemaphore;

	Poco::Thread *LookForFreeThread();
	void InitMgr();

};

#endif